var app = angular.module('qzApp', []);

var appId = getQueryString("id");

app.controller('qzAppController', function($scope, $http,AppService) {
	$scope.queryAssocatedInters=function(){
		$scope.interList;
	
		AppService.listAssoInter(appId).success(function (response) {		 
			$scope.interList = response.data;
			console.log($scope.interList);
		});	    
	}
	
	$scope.load=function(){
		$http.get(timestamp("qz/apps/get/"+appId)).success( function(response) {
			$scope.appdetail = response.data;
	   	});
	}
	$scope.load();
	$scope.queryAssocatedInters();
	
	$scope.refreshData=function(){
		$scope.load();
	}
   $scope.businessCancle=function(){
	   redirectUrl("manage/apps/","list.jsp");
   }
});

app.factory('AppService', function ($http) {
	var listAssoInter = function (id) {
		return $http.get(timestamp('qz/apps/getInters/'+id));
	}
	return {		
		listAssoInter:function(id){
			return listAssoInter(id);
		}
	}
});